package com.lichuang.springboot.study.lichuangspringbootproject.parent;

import com.lichuang.springboot.study.lichuangspringbootproject.parent.failure.Test;
import org.springframework.boot.Banner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
@EnableAutoConfiguration
@SpringBootApplication
public class LichuangSpringbootProjectApplication {
	@Bean
	public Parent test(){
	//	throw new NullPointerException();
		return new Parent();
	}

	public static void main(String[] args) {
		//流式构建springBoot引导程序
		new SpringApplicationBuilder().sources
				(LichuangSpringbootProjectApplication.class)
				.bannerMode(Banner.Mode.CONSOLE).web(WebApplicationType.NONE).run(args);
		//System.setProperty("spring.main.banner-mode","console");
		/*SpringApplication application=new SpringApplication(LichuangSpringbootProjectApplication.class);
		application.setWebApplicationType(WebApplicationType.NONE);
		application.setBannerMode(Banner.Mode.OFF);
		ConfigurableApplicationContext applicationContext=application.run(args);*/
		//application.run(args);
		//SpringApplication.run(LichuangSpringbootProjectApplication.class, args);

	}

}

